package summative;

import javax.swing.*;
import java.awt.*;

public class MainPanel extends JPanel
{
  public MainPanel(ViewList viewList, Menu menu)
  {
    super();
    setPreferredSize(new Dimension(500, 500));
    setLayout(new BorderLayout());
    
    
    VectorFocusList fList = new VectorFocusList();
    MenuItemList list = new MenuItemList(menu, fList, viewList);
    VectorList vectors = new VectorList(viewList, fList, menu, list);
    
    DrawListener dListener = new DrawListener(vectors);
    
    ViewPanel panel = new ViewPanel(fList);
    add(panel, BorderLayout.CENTER);
    panel.addMouseListener(dListener);
    viewList.addView(panel);
    
    TextPanel txtPanel = new TextPanel(vectors);
    add(txtPanel, BorderLayout.SOUTH);
    viewList.addView(txtPanel);
    
    Properties properties = new Properties(fList);
    add(properties, BorderLayout.EAST);
    viewList.addView(properties);
    
    
    setFocusable(true);
    setVisible(true);
  }
}
